home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
edit
/
nyword23.zip
/
NYWHELP.ZIP
/
NYWHELP.16
< prev
next >
Wrap
Text File
|
1986-09-29
|
2KB
|
47 lines
SEARCH AND SUBSTITUTION COMMANDS
<+SEARCH> (the F5 key) searches from the cursor position forwards for
the specified pattern.
<-SEARCH> (SHIFT F5 key) searches backwards from the cursor position
for the specified pattern.
For the two commands above, you are allowed to put any regular
expression as a pattern.
Regular expressions consist of the following metacharacters :
^ matches the beginning of a line
$ matches the end of a line
? matches any character
* matches 0 or more occurences of the previous pattern
[] character class
When you invoke these commands, you will be given the previous pattern
you typed in as a default. If you press <RETURN>, that pattern will be
used again. (If the previous pattern shown to you ends with a '!', it
means that you wanted to ignore the case.)
<TOGGLE CASE> (the ALT F5 key) toggles case sensitivity for searching.
<+SUBST> (F6 key) searches from the cursor position forwards for the
specified pattern, and for each occurence of the pattern, substitutes
the replacement string.
<-SUBST> (SHIFT F6 key) searches backwards from the cursor position,
then substitutes the replacement string.
The replacement string can have the metacharacter '&', which means
to substitute the matched pattern as part of the replacement. For
instance, if your pattern to search for was 'cat', and the replacement
string is 'alley&', then the word 'alleycat' will be replaced for each
occurence of 'cat'.
You are asked if you want to approve each substitution. If you
reply 'n', then the replacements will be made globally from the cursor
position to the end (or beginning) of the file. If you reply 'y', then
when the pattern is found you are asked if you want to replace it,
ignore it, or stop the substitution operation totally.
<GLOBALSUB> (the ALT F6 key) allows you to perform multiple sub-
stituions at once. When you use this command, the screen clears, and
you are given a new buffer in which to enter your substitution pat-
terns. Each line that you type must be of the form :
pattern=replacement
where the pattern can be any regular expression. After you have
finished typing all of the substitution patterns, press <CTRL D> and
the substitution operation will begin.